package com.seu.vcampus.view.library;

import com.seu.vcampus.client.VCampusClient;
import com.seu.vcampus.util.UIStyleUtil;
import com.seu.vcampus.vo.User;

import javax.swing.*;
import java.awt.*;

/**
 * 图书馆窗口（学生使用）
 * 采用按钮跳转模式的现代化图书馆界面
 * 
 * @author 虚拟校园开发团队
 * @since 2.2.0
 */
public class LibraryFrame extends JFrame {
    private VCampusClient client;
    private User currentUser;
    
    public LibraryFrame(VCampusClient client, User user) {
        super("图书馆 - " + user.getUsername());
        this.client = client;
        this.currentUser = user;
        
        initializeComponents();
        setupLayout();
        setupEventHandlers();
        
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(1200, 800);
        setLocationRelativeTo(null);
        setLocation(getX() + 50, getY() + 50);
    }
    
    private void initializeComponents() {
        // 设置全局样式
        UIStyleUtil.setupGlobalStyle();
        
        // 创建主面板
        LibraryMainPanel mainPanel = new LibraryMainPanel(client, currentUser);
        add(mainPanel);
    }
    
    private void setupLayout() {
        // 已在initializeComponents中完成
    }
    
    private void setupEventHandlers() {
        // 基础事件处理
    }
}